CC=gcc
CXX=g++
LD=gcc
AR=ar
RANLIB=ranlib
CFLAGS=-static -fPIC -fopenmp -std=c++20 -O3 -I.
CXXFLAGS=$(CFLAGS) -fmax-errors=5
LDFLAGS=-s -g -L. -fopenmp
LDLIBS=-lm -lstdc++ -lgomp

OBJS=
OBJS+=base64.o
OBJS+=CFile.o
OBJS+=strutil.o
OBJS+=cppini.o
OBJS+=SpinWaitOnAtomic.o
OBJS+=IntegralLib.o
OBJS+=StringEnumUtils.o
OBJS+=Bench.o
OBJS+=json.o
OBJS+=md5digest.o

all: libcpputils.a libcpputils.so

libcpputils.a: $(OBJS)
	$(AR) qc $@ $^
	$(RANLIB) $@

libcpputils.so: libcpputils.a
	$(LD) -shared $(LDFLAGS) $^ -o $@ $(LDLIBS)

clean:
	rm -f *.a *.o *.so
